Skip to content

Add StatusBar "auto" barStyle value#56978

Closed
zoontek wants to merge 3 commits into
facebook:mainfrom
zoontek:add-status-bar-auto
Closed

Add StatusBar "auto" barStyle value#56978
zoontek wants to merge 3 commits into
facebook:mainfrom
zoontek:add-status-bar-auto

Conversation

@zoontek
Copy link
Copy Markdown
Contributor

@zoontek zoontek commented May 27, 2026

Summary:

Adds support for barStyle="auto" on StatusBar. When set, the bar style is resolved against the current color scheme: light-content in dark mode, dark-content in light mode. The resolution re-runs when the system color scheme changes, while at least one StatusBar is mounted.

The behavior mirrors what expo-status-bar already exposes. The 'auto' name is the one we use at Expo. It is not necessarily the right name for React Native core, happy to switch to something else if reviewers prefer.

Changelog:

[GENERAL] [ADDED] - StatusBar: support barStyle="auto" to follow the current color scheme

Test Plan:

  • yarn jest packages/react-native/Libraries/Components/StatusBar passes, including a new test that asserts setBarStyle('auto') calls the native module with dark-content in light mode and light-content in dark mode.
  • Play with it in the RNTester app

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 27, 2026
@github-actions
Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 27, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 27, 2026

@zeyap has imported this pull request. If you are a Meta employee, you can view this in D106535143.

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@zeyap
Copy link
Copy Markdown
Contributor

zeyap commented May 29, 2026

@zoontek landing, but would be good to have some screenshot (from your RNTester test) or a jest e2e test here (cc @cortinico)

@meta-codesync meta-codesync Bot closed this in 61c8b04 May 29, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 29, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 29, 2026

@zeyap merged this pull request in 61c8b04.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zoontek in 61c8b04

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants